#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<string.h>

void Han(char arr[], int k)
{
	int sr = strlen(arr);
	int time = k % sr;
	for (int i = 0; i < time; i++)
	{
		int temp = arr[0];
		int j = 0;
		for (; j < sr - 1; j++)
		{
			arr[j] = arr[j + 1];
		}
		arr[j] = temp;
	}
}
int main()
{
	char arr[100] = "ABCDEF";
	int k = 0;
	scanf("%d", &k);
	Han(arr, k);
	printf("%s", arr);
	return 0;
}